package com.hashnode.cloudservice;

import com.hashnode.cloudservice.imp.PaymentHystrixServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
//@FeignClient(value = "CLOUD-PAYMENT-SERVICE")
//服务降级使用的类是PaymentHystrixServiceImpl
@FeignClient(value = "CLOUD-PAYMENT-SERVICE",fallback = PaymentHystrixServiceImpl.class)
public interface PaymentHystrixService {

    @GetMapping("/payment/hystrix/ok/{id}")
    public String paymentInfo_OK(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    public String paymentInfo_Tiemout(@PathVariable("id") Integer id);

}
